package com.feng.spring51.aop;

import org.aspectj.lang.annotation.*;
import org.junit.jupiter.api.Order;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Order(2)
public class UserProxy2 {

    @Pointcut(value = "execution(* com.feng.spring51.aop.User.add(..))")
    public void pointDemo(){

    }
    @Before(value = "pointDemo()")
    public void testBefore(){
        System.out.println("Before2");
    }
    @After(value = "pointDemo()")
    public void testAfter(){
        System.out.println("After2");
    }
    @AfterReturning(value = "pointDemo()")
    public void testAfterReturning(){
        System.out.println("AfterReturning2");
    }
    @AfterThrowing(value = "pointDemo()")
    public void testAfterThrowing(){
        System.out.println("testAfterThrowing2");
    }
    @Around(value = "pointDemo()")
    public void Around(){
        System.out.println("Around2");
    }

}
